import json
"""
序列化与反序列化不加s的用法
"""
data = {
    'name':['xunter','bobo'],
    'age':[18,28]
}
with open('data1.json','w+',encoding='utf-8') as f:
    # f.write(json.dumps(data))
    json.dump(data,f,ensure_ascii=False,indent=4)   #不转ascii码值  缩进为4

with open('data1.json','r',encoding='utf-8') as f:
    # python_data = json.loads(f.read())
    python_data = json.load(f)
    print(python_data)